package com.vt.admin.api.feign.fallback;

import com.vt.admin.api.dto.user.UserInfo;
import com.vt.admin.api.feign.RemoteUserService;
import com.vt.common.core.util.R;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;


@Slf4j
@Component
public class RemoteUserServiceFallbackImpl implements RemoteUserService {
    @Setter
    private Throwable cause;

    /**
     * 通过用户名查询用户、角色信息
     *
     * @param username 用户名
     * @param from     内外标志
     * @return R
     */
    @Override
    public R<UserInfo> info(String username, String from) {
        log.error("feign info 失败:{}", username, cause);
        return null;
    }

    @Override
    public R<UserInfo> social(String principal) {
        log.error("feign social 失败:{}", principal, cause);
        return null;
    }

    @Override
    public R<UserInfo> mobile(String mobile) {
        log.error("feign mobile 失败:{}", mobile, cause);
        return null;
    }

    @Override
    public R<UserInfo> unbind() {
        log.error("feign unbind 失败:{}", cause);
        return null;
    }
}
